package com.tuyrt.hi.hiitem.hiitem

import android.widget.ImageView
import androidx.recyclerview.widget.RecyclerView
import com.tuyrt.hi.hiitem.R

/**
 * author: Administrator on 2021/6/1.
 * desc:
 */
class ImageDataItem(var spanCount: Int, data: ItemData) :
    HiDataItem<ItemData, RecyclerView.ViewHolder>(data) {

    override fun onBindData(holder: RecyclerView.ViewHolder, position: Int) {
        val imageview = holder.itemView.findViewById<ImageView>(R.id.item_image)
        imageview.setImageResource(R.drawable.item_image);
    }

    override fun getItemLayoutRes() = R.layout.layout_list_item_image

    override fun getSpanSize(): Int {
        return spanCount
    }
}